@extends('layouts.backend')
@section('title')
    编辑
@endsection

@section('body')
    <div class="row">
        <div class="ibox">
            <div class="ibox-title">
                <h5>编辑</h5>
                <a href="{{route('backend.link.index')}}" class="btn btn-primary pull-right">返回列表</a>
                <div class="clearfix"></div>
            </div>
            <div class="ibox-content">

                <div class="row">
                    <div class="col-md-8">
                        <form action="" method="post">
                            @csrf
                            <input type="hidden" name="_method" value="PUT">
                            <div class="form-group">
                                <label>排序 @include('components.backend.required')</label>
                                <input type="text" name="sort" value="{{$link->sort}}" class="form-control" placeholder="排序（升序）" required>
                            </div>
                            <div class="form-group">
                                <label>链接名 @include('components.backend.required')</label>
                                <input type="text" value="{{$link->name}}" name="name" class="form-control" placeholder="链接名" required>
                            </div>
                            <div class="form-group">
                                <label>所属模块 @include('components.backend.required')</label>
                                <select name="module" class="form-control" >
                                    <option @if($link->module == 'nav') selected @endif value="nav">前台导航</option>
                                    <option @if($link->module == 'link') selected @endif value="link">友情连接</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>链接地址 @include('components.backend.required')</label>
                                <input type="text" name="url" value="{{$link->url}}" class="form-control" placeholder="链接地址" required>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </form>
                    </div>
                </div>

            </div>
        </div>
    </div>
@endsection
